/*
	libsimple_graphical - unambitious C++ graphical library
	https://notabug.org/namark/libsimple_graphical
	https://gitlab.com/namark/libsimple_graphical
	https://github.com/namark/libsimple_graphical

	Copyright (C) 2017-2019 respective authors/contributors

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "simple/support/enum.hpp"
#include "renderer_window.h"

using namespace simple::graphical;

renderer_window::renderer_window
(
	std::string title,
	int2 size,
	flags window_options,
	renderer::flags renderer_options,
	quality_hint renderer_scale_quality,
	int2 position
)
	: window(title, size, window_options, position),
	_renderer
	(
		SDL_CreateRenderer
		(
			guts().get(),
			-1,
			support::to_integer(renderer_options)
		),
		renderer_scale_quality,
		SDL_DestroyRenderer
	)
{}

const renderer & renderer_window::renderer() const noexcept
{
	return _renderer;
}

void renderer_window::update() const noexcept
{
	_renderer.update();
}
